package com.my.service;

import com.my.pojo.Orders;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import javax.persistence.criteria.CriteriaBuilder;

public interface IOrdersService {
    Page<Orders> showAllOrders(Pageable pageable, String context, Integer businessId);

    /**
     * 发货
     *
     * @param ordersId 订单id
     * @return
     *      状态码：
     *           0 - 成功
     *          -1 - 订单不存在
     *          -2 - 已发货
     *          -3 - sql错误
     */
    Integer sendOrders(Integer ordersId, Integer businessId);

    /**
     * 删除/取消订单
     *
     * @param ordersId  订单id
     * @return
     *      状态码：
     *           0 - 成功
     *          -1 - 订单不存在
     *          -2 - sql错误
     */
    Integer deleteOrders(Integer ordersId, Integer businessId);

    /**
     * 添加物流订单号
     *
     * @param ordersId 订单id
     * @param logistics 物流号
     * @return
     *      状态码：
     *           0 - 成功
     *          -1 - 订单不存在
     *          -2 - 未发货
     *          -3 - sql错误
     */
    Integer addOrdersLogistics(Integer ordersId, String logistics, Integer businessId);

    Integer addOrder(Orders orders, Integer goodsId);

    Integer addAddress(Integer ordersId, Integer addressId, Integer userId);

    Page<Orders> showAllOrdersForUser(Pageable pageable, String context, Integer userId);

    Orders showOneOrder(Integer ordersId, Integer userId);

    Integer confirm(Integer ordersId, Integer userId);
}
